package com.twu.biblioteca;

import java.io.IOException;
import java.util.Scanner;

public class BibliotecaApp {


    public static String welcomeMessage(){
        return "\nNamaste!\n";
    }

    public static void main(String[] args) throws IOException{

        Librarian librarian = new Librarian();
        Menu menu = new Menu();
        Scanner input = new Scanner(System.in);
        System.out.println(welcomeMessage());
        boolean isLoggedIn = false;

        while(true){

            if (isLoggedIn) {
                System.out.println(menu.displayOptionsAfterLogin());
            int choice = input.nextInt();
            isLoggedIn = librarian.processUserPostLogin(choice);
        } else {
            menu.displayOptionsBeforeLogin();
            int choice = input.nextInt();
            isLoggedIn = librarian.processUserPreLogin(choice);
        }

    }
}
}
